﻿@** Copyright 2013 Seven Spikes Ltd. All rights reserved. (http://www.nop-templates.com)
* http://www.nop-templates.com/t/licensinginfo
*@

@using System;
@using SevenSpikes.Nop.Plugins.ProductRibbons.Models
@model ProductRibbonsSettingsModel
@{
    var productIdObject = HttpContext.Current.Request.RequestContext.RouteData.Values.FirstOrDefault(x => x.Key.Equals("productid"));

    var productId = 0;

    if (productIdObject.Value != null)
    {
        Int32.TryParse(productIdObject.Value.ToString(), out productId);
    }

    Html.AddCssFileParts("~/Plugins/SevenSpikes.Nop.Plugins.ProductRibbons/Styles/Ribbons.common.css");
    Html.AddCssFileParts(string.Format("~/Plugins/SevenSpikes.Nop.Plugins.ProductRibbons/Themes/{0}/Content/Ribbons.css",Model.Theme));

    Html.AddScriptParts("~/Plugins/SevenSpikes.Nop.Plugins.ProductRibbons/Scripts/jquery.json-2.4.min.js");
    Html.AddScriptParts("~/Plugins/SevenSpikes.Core/Scripts/SevenSpikesExtensions.js");
    Html.AddScriptParts("~/Plugins/SevenSpikes.Nop.Plugins.ProductRibbons/Scripts/ProductRibbons.min.js");
}

<div id="product-ribbon-info" data-productId="@productId" data-retrieveProductRibbonsUrl="@Url.Action("RetrieveProductRibbons", "ProductRibbons")" 
     data-productBoxSelector="@Model.ProductBoxSelector" 
     data-productBoxPictureContainerSelector="@Model.ProductBoxPictureContainerSelector"
     data-productPagePicturesParentContainerSelector="@Model.ProductPagePicturesParentContainerSelector"
     data-productPageBugPictureContainerSelector="@Model.ProductPageBugPictureContainerSelector">
</div>
